<?php


use Hx\App;
use Hx\Request;
use Hx\Router;

App::setConfig('blogUrl', str_replace('api', 'blog', Request::$baseUrl));

Router::setRestful(true);

Router::setIgnoreExt(true);

//---------------

Router::get(array('/', '/index/'), array('Index', 'main'));

Router::post('/authorize/', array('User', 'authorize'));

Router::post('/check/', array('User', 'check'));

//---- blog link

Router::get('/blog/', array('Blog', 'getList'));

Router::post('/blog/', array('Blog', 'addBlog'));

Router::get('/blog/all/', array('Blog', 'getArchive'));

Router::get('/blog/private/', array('Blog', 'getPrivates'));

Router::get('/blog/:id/', array('Blog', 'getOne'));

Router::post('/blog/status/', array('Blog', 'changeStatus'));

//------ category link

Router::get('/category/', array('Category', 'getAll'));

Router::post('/category/', array('Category', 'addCategory'));

Router::get('/category/:id/', array('Category', 'getOne'));

Router::post('/category/:id/', array('Category', 'updateCategory'));

Router::delete('/category/:id/', array('Category', 'deleteCategory'));

//------- comment link

Router::get('/comment/', array('Comment', 'getList'));

Router::get('/comment/tree/:id', array('Comment', 'getTree'));

Router::get('/comment/private/', array('Comment', 'getPrivates'));

Router::get('/comment/:id', array('Comment', 'getOne'));
